Multiple computer programs, processes, applications, and/or threads running on a computer or processor often need to access shared data or hardware, such as a memory block, register, device driver, or other common resource. To avoid data collisions and data corruption, locks are typically used to limit access to a shared resource to only one process at a time. This prevents multiple users from concurrently modifying the same shared data. For example, a group of processes may each have to acquire a lock before accessing a particular shared resource. When one process has acquired the lock, none of the other processes can acquire the lock, which provides exclusive access and control of the shared resource to the process that first acquired the lock.
Where multiple execution units try to acquire the same lock, the ability to acquire the lock may depend in part upon how fast an execution unit accesses the lock and how often the execution unit reattempts to acquire the lock when a first attempt is unsuccessful. For example, an execution unit that is remote from other execution units may be at a disadvantage due to the transmission delay of lock acquisition signals compared to the delays associated with closer execution units. If two units begin an attempt to acquire the lock at approximately the same time, the closer execution unit is likely to always have its request arrive first, and requests from a farther execution unit are likely to be too late. Additionally, when an execution unit cannot acquire a lock that was already in use by another device, the execution unit may back off for a period and will reattempt to acquire the lock at a later time. In the meantime, other devices may acquire the lock before the execution unit has reattempted acquiring the lock. As a result, if a number of other devices are attempting to acquire the lock, the execution device may have difficulty acquiring the lock in a timely manner.